package com.cxd.service.impl;
import com.cxd.entity.EbComment;
import com.cxd.mapper.EbCommentMapper;
import com.cxd.service.IEbCommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class EbCommentServiceImpl implements IEbCommentService {
    @Autowired
    private EbCommentMapper ebCommentMapper;
    @Override
    public List<EbComment> listByPage(Integer page, Integer pageSize){
        Integer from = (page - 1)*pageSize;
        return ebCommentMapper.listByPage(from,pageSize);
    }
    @Override
    public EbComment selectByCondition(Integer ecId){
        return ebCommentMapper.selectByCondition(ecId);
    };
    @Override
    public int updateById(EbComment ebComment){
        return ebCommentMapper.updateById(ebComment);
    };
    @Override
    public int delete(Integer ecId){
        return ebCommentMapper.delete(ecId);

    };
    @Override
    public Integer findTotalPage(Integer pageSize) {
        return ebCommentMapper.getTotalPage(pageSize);
    }
    @Override
    public Integer save(EbComment ebComment){
        return ebCommentMapper.save(ebComment);
    }
}
